<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="font-size: 100px;">
  <head>
    <base href="<%=basePath%>">
    
    <title>智慧消防</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/amazeui.min.css" type="text/css"></link>
	<style type="text/css">
        body{
            height: 100%;
            font-size: 0.15rem;
        }
        ul{
            padding-left: 0.2rem;
        }
        ul li{
            line-height: 0.35rem;
        }
        ul select{
            height: 0.4rem;
            width: 2rem;
            border: 0.5px #a9a9a9 solid;
        }
        option{
            font-size: 0.18rem;
        }

        label{
            width:25%;
            white-space:nowrap;
            text-align:left;
            margin-left: 0.15rem;
            margin-top: 5px;
            font-weight: normal;
        }
        input {
            padding: 0.05px;
            width: 2rem;
            line-height: 0.3rem;
            padding: 3px;
        }
        .btn-submit{
            bottom: 0;
            position: fixed;
            color: white;
            background-color: rgb(4,177,15);
            text-align: center;
            line-height: 0.4rem;
            border-radius:5px;
            width: 95%;
            margin: 0px 0.08rem;
            margin-bottom: 10px;
        }
        .info {
            float: right;
            margin-right: 8px;
            font-size: 0.13rem;
            margin: 5px  8px;
        }
        #weChat img {
            width: 0.15rem;
            height: 0.18rem;
            margin-bottom: 2px;
            margin-left: 10px;
        }
        #userImg {
            border-radius: 18px;
            width: 36px;
            height: 36px;
            margin-top: 2px;
        }
    </style>
	<script type="text/javascript">
        $(function(){
            var userInfo =  JSON.parse(user);
            var userImg = userInfo.userImg;
            if (userImg != null && userImg.length > 0) {
                $("#userImg").attr('src', '${linkPath}' + 'smartfire/wx/' + userImg.split('smartfire/')[1]);
            } else {
                var sex = userInfo.sex;
                if (sex == '2') {
                    $("#userImg").attr('src', '<%=path %>/images/common/female.png');
                }else{
                    $("#userImg").attr('src', '<%=path %>/images/common/male.png');
                }
            }
            $("#truename").html(userInfo.truename);
            $("#username").html(userInfo.username);
            $("#orgName").html(userInfo.orgName);
            $("#city").html(userInfo.city);
//            var openId = userInfo.openId;
//            if (openId != null && openId.length>0) {
//                $("#weChat").html("已绑定");
//            } else {
//                $("#weChat").html("未绑定");
//            }

            $('.btn-submit').click(function () {
                logOut();
            });
        });

        function logOut(){
            localStorage.clear();
            sessionStorage.clear();
            location.href ='<%=path %>';
        }
	</script>
  </head>
  
  <body>
      <div style="background-color: white">
          <div style="line-height: 0.4rem;width: 100%;text-align: center;background-color: white;position: fixed;top: 0;z-index: 100; border-bottom: 1px solid #ccc;">
              <img onclick="javascript:history.back(-1);" src="<%=path %>/images/common/return.png" style="width: 0.2rem;float: left;margin: 0.1rem 0 0 0.05rem" alt="">
              <span style="padding-right: 0.26rem;font-size: 0.2rem">个人中心</span>
          </div>
          <div style="margin-top: 0.4rem">
              <ul class="am-list">
                  <li style="line-height: 0.4rem">
                      <div class="info">
                          <img id="userImg" name="userImg"/>
                      </div>
                      <label>头像</label>
                  </li>
                  <li>
                      <div class="info">
                          <span id="truename" name="truename"></span>
                      </div>
                      <label>姓名</label>
                  </li>
                  <li>
                      <div class="info">
                          <span id="username" name="username"></span>
                      </div>
                      <label>用户名</label>
                  </li>
                  <li>
                      <div class="info">
                          <span id="orgName" name="orgName"></span>
                      </div>
                      <label>所在单位</label>
                  </li>
                  <li>
                      <div class="info">
                          <span id="city" name="city"></span>
                      </div>
                      <label>所在城市</label>
                  </li>
                  <%--<li>--%>
                      <%--<div class="info">--%>
                          <%--<span id="weChat" name="weChat"></span>--%>
                      <%--</div>--%>
                      <%--<label>微信绑定</label>--%>
                  <%--</li>--%>
                      <div class="btn-submit">退出登录</div>
              </ul>
          </div>
      </div>
  </body>
</html>
